|
In computer science, and specifically in compiler and assembler design, a literal pool is a lookup table used to hold literals during assembly and execution. Multiple (local) literal pools are typically used only for computer architectures that lack branch instructions for long jumps, or have a set of instructions optimized for shorter jumps. Examples of such architectures include ARM architecture and the IBM System/360 and later architectures, which had a number of instructions which took 12-bit address offsets. In this case, the compiler would create a literal table on every 4K page; any branches whose target was less than 4K bytes away could be taken immediately; longer branches required an address lookup via the literal table. The entries in the literal pool are placed into the object relocation table during assembly, and are then resolved at link edit time. In certain ways, a literal pool resembles a TOC or a global offset table (GOT), except that the implementation is considerably simpler, and there may be multiple literal tables per object. Perhaps the most common type of literal pool are the literal pools used by the LDR Rd,=const pseudo-instruction in ARM assembly language〔("Writing ARM Assembly Language > Literal pools" ) 〕 and similar instructions in IBM System/360 assembly language.〔 ("High Level Assembler for z/OS & z/VM & z/VSE V1R6 (HLASM V1R6) Language Reference": Literal pool ) 〕 which are compiled to a LOAD with a PC-relative addressing mode and the constant stored in the literal pool. Often some particular constant value will be used multiple times in a program. Many linkers, by default, store each unique constant once, in a single combined literal pool; that improves code size.〔 William von Hagen. ("The Definitive Guide to GCC" ). 〕 Implementations of the Java programming language have a "string literal pool" and a "class constant pool". 〔 Jacquie Barker. ("Beginning Java Objects: From Concepts to Code": "literal pool" ). 〕 ==References== 抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Literal pool」の詳細全文を読む スポンサード リンク
|